module top_module (
    input clk,
    input a,
    input b,
    output q,
    output state  );

	always@(posedge clk)begin
		state<=(a==b)?a:state;
	end
	
	assign q=(state==1'b1)?(a==b):(~a==b);
	
endmodule